package com.amazon.controller;

import com.amazon.model.*;
import com.amazon.service.ShopService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/amazon")
public class ShopController {

    @Resource
    private ShopService service;
    @GetMapping("/shopList")
    public CommonResult shopList(){
        ShopListModel shopList = service.getShopList();
        return CommonResult.ok(shopList);
    }

    @GetMapping("/shopPersonInfo")
    public CommonResult getShopPersonInfo(){
        CompanyModel companyModel = service.getShopPersonInfo();
        return CommonResult.ok(companyModel);
    }

    @GetMapping("/shopBody")
    public CommonResult getShopBody(){
        ShopBodyModel shopBody = service.getShopBody();
        return CommonResult.ok(shopBody);
    }

    @GetMapping("/getShopAddr")
    public CommonResult getShopAddr(){
        BusinessModel businessModel = service.getShopAddr();
        return CommonResult.ok(businessModel);
    }
}
